<div class="container-fluid">
	<div id="pad-wrapper">
		<!-- products table-->
		<!-- the script for the toggle all checkboxes from header is located in js/theme.js -->
		<div class="table-wrapper products-table section">
			<div class="row-fluid head">
				<div class="span12">
					<h4>菜单列表</h4>
				</div>
			</div>
			
			<form action="" method="get" name="search">
			<div class="row-fluid filter-block">
				<div class="pull-left">
				<a class="btn-flat success new-product" href="/sys/menu-add">添加菜单</a>
				</div>
				<div class="pull-right">
					菜单类型：
					<select name="search_select">
						<option value="1" <?php if($search_select == 1):?> selected="selected" <?php endif;?>>全部</option>
						<option value="2" <?php if($search_select == 2):?> selected="selected" <?php endif;?>>显示菜单</option>
						<option value="3" <?php if($search_select == 3):?> selected="selected" <?php endif;?>>不显示的菜单</option>
					</select>
					<a class="btn-flat success" onclick="document.forms['search'].submit();">搜索</a>
				</div>
			</div>
			</form>
			
			<div class="row-fluid">
				<table class="table table-hover">
					<thead>
						<tr>
							<th class="span3">权限名称</th>
							<th class="span3"><span class="line"></span>连接</th>
							<th class="span3"><span class="line"></span>控制器</th>
							<th class="span3"><span class="line"></span>操作</th>
						</tr>
					</thead>
					<tbody>
						<?php if($list):?>
						<?php foreach ($list as $item):?>
						<?php if($item['child']):?>
						<?php foreach ($item['child'] as $child_item):?>
						<!-- row -->
						<tr class="first">
							<td>|------<?php echo $child_item['name']?></td>
							<td class="description"><?php echo $child_item['url']?></td>
							<td><?php echo $child_item['controller']?>
							</td>
							<td>
								<button type="button" class=" btn-flat primary" onclick="window.location.href='/sys/menu-edit/id/<?php echo $child_item['id']?>'">编辑</button>
							</td>
						</tr>
						
						<?php endforeach;?>
						<?php endif;?>
						<!-- row -->
						<tr class="first">
							<td><?php echo $item['name']?></td>
							<td class="description"><?php echo $item['url']?></td>
							<td><?php echo $item['controller']?>
							</td>
							<td>
								<button type="button" class=" btn-flat primary" onclick="window.location.href='/sys/menu-edit?id=<?php echo $item['id']?>'">编辑</button>
								<button class="btn-flat primary" data-toggle="modal" data-target="#myModal" menu-id="<?php echo $item['id']?>">角色管理</button>
								<?php if($item['parent_id'] == 0):?>
								<button type="button" class=" btn-flat primary" onclick="window.location.href='/sys/menu-add?id=<?php echo $item['id']?>'">添加子菜单</button>
								<?php endif;?>
							</td>
						</tr>
						<?php endforeach;?>
						<?php endif;?>
					</tbody>
				</table>
			</div>
		</div>
		<!-- end products table -->
		
		
		<!-- 模态框（Modal） -->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
		   aria-labelledby="myModalLabel" aria-hidden="true">
		   <div class="modal-dialog">
		      <div class="modal-content">
		         <div class="modal-header">
		            <button type="button" class="close" 
		               data-dismiss="modal" aria-hidden="true">
		                  &times;
		            </button>
		            <h4 class="modal-title" id="myModalLabel">
		               角色管理
		            </h4>
		         </div>
		         <div class="modal-body">
		            在这里添加一些文本
		         </div>
		         <div class="modal-footer">
		            <button type="button" class="btn-flat primary" data-dismiss="modal">关闭
		            </button>
		            <button type="button" class="btn-flat primary">
		               提交更改
		            </button>
		         </div>
		      </div><!-- /.modal-content -->
		</div><!-- /.modal -->
		
	</div>
	<div class="pagination pull-right">
	</div>
</div>
<script type="text/javascript">
$(function(){

	
});
</script>

